package com.mokairui.util;

import java.util.concurrent.TimeUnit;

/**
 * @author Mokairui
 * @Description
 * @Since 2021/7/4
 */
public class SmallTool {
    public static void printThreadAndTime(String msg) {
        System.out.println(Thread.currentThread().getName() + " : "
                + System.currentTimeMillis() + " : " + msg);
    }

    public static void sleepSecond(int time) {
        try {
            TimeUnit.SECONDS.sleep(time);
        } catch (InterruptedException e) {
            System.out.println(Thread.currentThread().getName() + "休眠出错");
        }
    }

    public static void sleepMills(int time) {
        try {
            TimeUnit.MILLISECONDS.sleep(time);
        } catch (InterruptedException e) {
            System.out.println(Thread.currentThread().getName() + "休眠出错");
        }
    }
}
